<template>
  <div class="icon-test-container">
    <h1>图标测试页面</h1>
    
    <div class="icon-section">
      <h2>SVG 图标测试</h2>
      
      <div class="icon-row">
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="24" />
          <span>arrow-up</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="arrow-down" size="24" />
          <span>arrow-down</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="minus" size="24" />
          <span>minus</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="refresh" size="24" />
          <span>refresh</span>
        </div>
      </div>
      
      <h2>颜色测试</h2>
      
      <div class="icon-row">
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="24" color="#52c41a" />
          <span style="color: #52c41a">绿色</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="arrow-down" size="24" color="#f5222d" />
          <span style="color: #f5222d">红色</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="minus" size="24" color="#1890ff" />
          <span style="color: #1890ff">蓝色</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="refresh" size="24" color="#722ed1" />
          <span style="color: #722ed1">紫色</span>
        </div>
      </div>
      
      <h2>大小测试</h2>
      
      <div class="icon-row">
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="16" />
          <span>16px</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="24" />
          <span>24px</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="32" />
          <span>32px</span>
        </div>
        
        <div class="icon-item">
          <SvgIcon name="arrow-up" size="48" />
          <span>48px</span>
        </div>
      </div>
    </div>
    
    <div class="back-button">
      <el-button type="primary" @click="goBack">返回</el-button>
    </div>
  </div>
</template>

<script>
import { SvgIcon } from '@/components/icons'
import { useRouter } from 'vue-router'

export default {
  name: 'IconTest',
  components: {
    SvgIcon
  },
  setup() {
    const router = useRouter()
    
    const goBack = () => {
      router.push('/dashboard')
    }
    
    return {
      goBack
    }
  }
}
</script>

<style scoped>
.icon-test-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #001529;
  color: #fff;
  min-height: 100vh;
}

h1, h2 {
  color: #1eb1fc;
  margin-bottom: 20px;
}

.icon-section {
  margin-bottom: 40px;
}

.icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  min-width: 100px;
}

.icon-item span {
  margin-top: 10px;
  font-size: 14px;
}

.back-button {
  margin-top: 40px;
  text-align: center;
}
</style>
